import Vue from 'vue'
// 引入vue
import Router from 'vue-router'
// 引入路由
import Index from '@/components/index'
// 引入Index组件
import Shop from '@/components/shop'
// 引入Shop组件
import List from '@/components/list'
// 引入List组件
import Cart from '@/components/cart'
// 引入Cart组件
import Order from '@/components/order'
// 引入Order组件
import Mine from '@/components/mine'
// 引入Mine组件
import Login from '@/components/login'
// 引入Login组件
import Register from '@/components/register'
// 引入Register组件
import Details from '@/components/details'
// 引入Details组件
import DetailsList from '@/components/detailsList'
// 引入DetailsList组件

Vue.use(Router)

export default new Router({
  routes: [
    {
      path:'/',
      redirect:'/index'
    },
    {
      path: '/index',
      component: Index
    },
    {
      path:'/index/shop/:shopInfo',
      name:'shop',
      props:true,
      component:Shop
    },
    {
      path:'/index/list',
      component:List,

    },
    {
      path:'/index/cart',
      component:Cart
    },
    {
      path:'/index/order',
      component:Order
    },
    {
      path:'/index/mine',
      component:Mine
    },
    {
      path:'/mine/login',
      component:Login
    },
    {
      path:'/mine/register',
      component:Register
    },
    {
      path:'/details',
      component:Details
    },
    {
      path:'/details/list',
      component:DetailsList
    }
  ]
})

